js:
let d = [];
MY_URL = MY_URL.split("##")[1];
if (getMyVar("MY_URL", "0") !== MY_URL) {
    putMyVar("MY_URL", MY_URL);
    require(http + "dwer.js");

    try {
        var tabs = pdfa(html, 分列);
    } catch (e) {
        var tabs = "k";
    };//log(tabs);
    if (tabs == "k") {
        try {
            if (/midukanshu|api|pigqq|pysmei/.test(MY_URL)) {
                let list = /pigqq|pysmei/.test(MY_URL) ? JSON.parse(html.replace(/\}\,\]/g, "}]")).data.list[0].list : /midukanshu/.test(MY_URL) ? JSON.parse(html) : JSON.parse(html).data.volumes[0].chapters;
                //log(list)
                var lists = [];
                let td = [];
                for (let j in list) {
                   if (/pigqq|pysmei/.test(MY_URL)) {
                        title = list[j].name;
                        url = (/pysmei/.test(MY_URL) ? "https://scxs.pysmei.com" : "https://contentxs.pigqq.com") + "/BookFiles/Html/" + MY_PARAMS.bkid + "/" + MY_PARAMS.bookid + "/" + list[j].id + ".html";
                    } else
                    if (/midukanshu/.test(MY_URL)) {
                        title = list[j].title;
                        url = "https://book.midukanshu.com/book/chapter/segment/master/" + list[j].bookId + "_" + list[j].chapterId + ".txt?md5=" + list[j].content_md5;
                    } else {
                        title = list[j].name;
                        url = "http://api.17k.com/v2/book/" + MY_PARAMS.bookid + "/chapter/" + list[j].id + "/content?app_key=4037465544&_versions=979&client_type=1&_filter_data=1&channel=2&merchant=17Khwyysd&_access_version=2&cps=0";
                    }
                    td.push(title + "$" + url);
                }; //log(td)
                lists.push(td.join("#"));
            } else {
                let list = pdfa(html, 列表);
                var lists = [];
                let td = [];
                for (let j in list) {
                    td.push(pdfh(list[j], "span||a&&Text") + "$" + pd(list[j], "a&&href"));
                }; //log(td)
                lists.push(td.join("#"));
            }
        } catch(e) {
            var lists = "";
        };
    } else {
        try {
            let cfg = {
                分页列表: 分列,
                分页链接: 分链,
                分页请求头: {
                    "User-Agent": MOBILE_UA,
                },
                一页章节数: /xs7/.test(MY_URL) ? 100 : 20,
                章节列表: 列表,
                章节标题: "a&&Text",
                章节链接: "a&&href",
                缓存个数: 15
            }

            var code = html;
            var caches;

            function getCache() {
                let c = readFile("hiker://files/cache/Yue/list.js") || "[]";
                caches = JSON.parse(c)
                let url = getUrl()
                //log(url)
                addListener("onRefresh", $.toString((url) => {
                    let c = readFile("hiker://files/cache/Yue/list.js") || "[]";
                    c = JSON.parse(c)
                    var che = {
                        url: url,
                        page: 0,
                        chapters: []
                    };
                    for (let i = 0; i < c.length; i++) {
                        if (c[i].url == che.url) {
                            c[i] = che;
                            //log("clear:" + url)
                            saveFile("hiker://files/cache/Yue/list.js", JSON.stringify(c));
                            break
                        }
                    }
                }, url))
                for (let it of caches) {
                    if (it.url == url) {
                        return it;
                    }
                }
                return {
                    url: url,
                    page: 0,
                    chapters: []
                }
            }

            function saveCache(che) {
                let c = caches
                if (c.length > cfg.缓存个数) {
                    c.shift()
                }
                let exist = false
                for (let i = 0; i < c.length; i++) {
                    if (c[i].url == che.url) {
                        c[i] = che;
                        exist = true;
                        break
                    }
                }
                if (!exist) {
                    c.push(che)
                }
                saveFile("hiker://files/cache/Yue/list.js", JSON.stringify(c))
            }

            let cache = getCache();

            let mp = pdfa(code, cfg.分页列表)
            let page = mp.length;
            log("实际页数：" + page)
            log("缓存页数：" + cache.page)
            /*
            if (page == cache.page) {
                //已完结，目录全部缓存了
                setResult(cache.chapters)
                return
            }
            */
            //解析本地没有的缓存
            let urls = []
            let htmls = []
            //log(mp)
            for (let i = cache.page; i < mp.length; i++) {
                if (i == 0) {
                    htmls.push(code)
                    continue
                }
                let it = mp[i];
                urls.push({
                    url: pd(it, cfg.分页链接),
                    options: {
                        headers: cfg.分页请求头 || {}
                    }
                })
            }
            //log(urls)
            let d = [].concat(cache.chapters)
            htmls = htmls.concat(batchFetch(urls))
            //log(htmls)
            for (let it of htmls) {
                if (it == "") {
                    break
                }
                let list = pdfa(it, cfg.章节列表);
                var tmet = [];
                let td = [];
                for (let ii of list) {
                    td.push(pdfh(ii, cfg.章节标题) + "$" + pd(ii, cfg.章节链接))
                }
                tmet.push(td.join("#"));
                //log(tmet)
                //log(list.length)
                if (list.length == cfg.一页章节数) {
                    //章节齐全的才放本地缓存
                    cache.page = cache.page + 1
                    cache.chapters = cache.chapters.concat(tmet)
                }
                d = d.concat(tmet);
                putMyVar("list", d.join("#"));
            }

            saveCache(cache)
        } catch (e) {
            var lists = "";
        };
    };

    var 名 = MY_PARAMS.title;
    var 类 = MY_PARAMS.lei;
    var 更 = MY_PARAMS.desc;
    var 作 = MY_PARAMS.zuo;
    var 图 = MY_PARAMS.img;
    var 介 = MY_PARAMS.jie;

    var titles = "书名：" + 名 + "\n" + 作 + "\n" + 更;

    var descs = "书名：" + 名 + "\n" + 作 + "\n" + 类 + "\n" + 更 + "\n\n" + "详情介绍：" + "\n" + 介.replace(/简介：/, "") + "\n\n";
    if (tabs !== "k") {
        var lists = [getMyVar("list")];
    } else {
        var lists = lists;
    }
    let erji = {
        "名": 名,
        "图": 图,
        "介": 介,
        "titles": titles,
        "descs": descs,
        "lists": lists,
    };
    saveFile("hiker://files/cache/Yue/erji/" + base64Encode(MY_URL) + ".js", JSON.stringify(erji));
} else {
    try {
        eval("var erji = " + readFile("hiker://files/cache/Yue/erji/" + base64Encode(MY_URL) + ".js"));

        var 名 = erji.名;
        var 图 = erji.图;
        var 介 = erji.介;
        var titles = erji.titles;
        var descs = erji.descs;
        var lists = erji.lists;
    } catch (e) {
        clearMyVar("MY_URL");
    };
};

let Color = "#f13b66a";
let Color1 = "#098AC1";
let Color2 = "#19B89D";

d.push({
    title: '‘‘’’<b><small><font color="#b0e0e6">' + titles + '</font></small></b>',
    desc: '‘‘’’<b><small><b><font color="#708090"></b>' + '<font color="#778899">' + 介 + '</font></font></small></b>',
    url: 图,
    img: 图,
    col_type: "movie_1_vertical_pic_blur",
    extra: {
        gradient: true
    }
});

let ertu = "https://hikerfans.com/tubiao/more/";

let lie = ["一行", "两行", "三行", "四行"];
let erh = getItem("h2", "两行");
    let bia = lie.map((tit) => {
        return tit == erh ? '““<b>' + tit + '</b>””' : tit;
    });
    d.push({
        title: getItem("h2", "两行"),
        url: $(bia, 2, "切换排行").select(() => {
            setItem("h2", input.replace(/\“|\”|\<b\>|\<\/b\>/g, ""));
            refreshPage(false);
            return "hiker://empty"
        }),
        img: "https://hikerfans.com/tubiao/q/56.png",
        col_type: "icon_small_3"
    });
let col = getItem("h2", "两行") == "两行" ? "text_2" : getItem("h2", "两行") == "一行" ? "text_1" : getItem("h2", "两行") == "三行" ? "text_3" : "text_4";

d.push({
    title: "详情",
    url: $("hiker://empty#noRecordHistory##noHistory#").rule((text) => {
        setResult([{
            title: text,
            col_type: "long_text"
        }])
    }, descs),
    img: "https://hikerfans.com/tubiao/q/76.png",
    col_type: "icon_small_3",
    extra: {
        inheritTitle: false
    }
})

let bak = getMyVar("bak", "0");
let surl = "";
if (bak == "1") {
    surl = $("#noLoading#").lazyRule(() => {
        back(false);
        clearMyVar("bak");
        return "hiker://empty";
    })
} else {
    surl = $("#noLoading#").lazyRule((input) => {
        putMyVar("Mysou", input);
        return $("hiker://empty#noRecordHistory##noHistory#fypage").rule(() => {
            require(config.依赖);
            yso()
        });
    }, 名);
}

d.push({
    title: "搜书",
    url: surl,
    img: "https://hikerfans.com/tubiao/q/13.png",
    col_type: "icon_small_3",
    extra: {
        erji: "1",
        inheritTitle: false,
        key: 名,
    }
});

function setLists(lists, index) {
    d.push({
        col_type: "big_blank_block"
    })
    d.push({
        col_type: "line_blank"
    })
    d.push({
        col_type: "big_blank_block"
    })

    let lisd = "";
    try {
        let listt = lists[index].split("#");
        try {
            let lists1 = listt[0].split("$")[0];
            let lists2 = listt[listt.length - 1].split("$")[0];
            if (parseInt(lists1.match(/(\d+)/)[0]) > parseInt(lists2.match(/(\d+)/)[0])) {
                lisd = listt.reverse();
            } else {
                lisd = listt;
            }
        } catch (e) {
            lisd = listt;
        }
    } catch (e) {};

    let list = "";
    try {
        if (getItem("zf", "f") == "z") {
            list = lisd;
        } else {
            list = lisd.reverse();
        };
    } catch (e) {
        list = "";
    };

    let zftu = "https://hikerfans.com/tubiao/messy/";
    let paix = '<span style="color:' + Color2 + '">阅读排序' + "<small><font color='grey'>" + '\t\t共 ' + list.length + ' 条\t\t\t</font></small></span>';

    d.push({
        title: getItem("zf", "f") == "z" ? paix + '<span style="color: #33cccc">▴</span>' : paix + '<span style="color: #ff7f50">▾</span>',
        url: $("#noLoading#").lazyRule(() => {
            if (getItem("zf", "f") == "z") {
                clearItem("zf");
            } else {
                setItem("zf", "z");
            }
            refreshPage(false);
            return "#noHistory#hiker://empty"
        }),
        img: getItem("zf", "f") == "z" ? zftu + "123.svg" : zftu + "124.svg",
        col_type: "text_icon"
    });

    try {
        if (list == "") {
            d.push({
                title: "暂无书源",
                url: "hiker://empty#noHistory#",
                col_type: "text_center_1",
                extra: {
                    lineVisible: false
                }
            });
        } else {
            for (let j = 0; j < list.length; j++) {
                let jm = list[j].split("$")[0].replace(/\(.*\)|\（.*\）/g, "");
                let url = list[j].split("$")[1] + "#autoPage##readTheme#";

                d.push({
                    title: "‘‘’’<small>" + jm + "</small>",
                    url: $("hiker://empty##" + (/ikanshuba./.test(url) ? url.replace(/.html/g, "_3.html") : url)).rule(() => {
                        require(config.依赖);
                        return content()
                    }),
                    col_type: col
                });
            }
        }
    } catch (e) {}
};
setLists(lists, getMyVar(MY_URL, "0"));

d.push({
    col_type: "big_blank_block"
})
d.push({
    col_type: "big_blank_block"
})
d.push({
    col_type: "big_blank_block"
})
d.push({
    col_type: "line_blank"
})
d.push({
    col_type: "big_blank_block"
})

d.push({
    title: "‘‘’’<small><font color=#20b2aa>数据资源收集于网络，海阔不提供任何资源！</font></small>",
    desc: "‘‘’’<small><font color=#ff7f50>本规则仅限学习与交流，请导入后24小时内删除，请勿传播！</font></small>",
    url: "hiker://empty",
    col_type: "text_center_1",
    extra: {
        lineVisible: false
    }
}, {
    col_type: "big_blank_block"
}, {
    title: "‘‘’’<small>－－到\t底\t了－－</small>",
    url: "hiker://empty",
    col_type: "text_center_1"
});
setResult(d);

setLastChapterRule("js:" + $.toString((http) => {
    MY_URL = MY_URL.split("##")[1];
    require(http + "dwer.js");

    let title = "";
    try {
        let list = pdfa(html, 列表p);
        let title1 = pdfh(list[0], 'a&&Text');
        let title2 = pdfh(list[list.length - 1], "a&&Text");
        try {
            if (parseInt(title1.match(/(\d+)/)[0]) > parseInt(title2.match(/(\d+)/)[0])) {
                title = title1;
            } else {
                title = title2;
            };
        } catch (e) {
            title = title2;
        }
    } catch (e) {
        title = "未更新";
    }
    setResult("更新：" + title);
}, http));

//by随风 重新整合及优化样式
//二级模板  代码来自众大佬
